#Region " Imports"
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Diagnostics
Imports System.ComponentModel.Design
Imports System.ComponentModel.Design.Serialization
Imports System.Drawing
Imports System.Drawing.Design.UITypeEditor
Imports System.Drawing.Design
Imports System.Data.SqlClient
Imports System.IO
Imports System.Security.Permissions
#End Region

Namespace SuperGridControl
    ''' <summary>
    ''' Adjust of the namespace
    ''' </summary>
    ''' <remarks></remarks>

    Public Class ColumnControl
        ''' <summary>
        ''' In this class we will put all the properties and methods to enable more than one control per cell.
        ''' </summary>
        ''' <remarks>The creation of this class was needed cause in some page design we gor more than one control inside the cell.</remarks>
        ''' 


#Region " Enum"
        Public Enum TypeOfControl As Integer
            ''' <summary>
            ''' Enum to show to the developer wich control types are enabled for use within the control
            ''' </summary>
            ''' <remarks>
            ''' On next versions we will change this, making possible for the developer to choose a control that is referenced by the project.
            ''' </remarks>
            Text
            Label
            CheckBox
            OptionBox
            Link
            DropdownList
        End Enum
#End Region

#Region " Variables"
        ''' <summary>
        ''' Here we will declare all the variables needed by the control
        ''' </summary>
        ''' <remarks></remarks>
        Private _visible As Boolean = True
        Private _enabled As Boolean = True
        Private _width As System.Web.UI.WebControls.Unit
        Private _height As System.Web.UI.WebControls.Unit
        Private _controlType As TypeOfControl
        Private _dataTextField As String
        Private _CSSClass As String
        Private _horizontalAlignment As System.Web.UI.WebControls.HorizontalAlign
        Private _verticalAlignment As System.Web.UI.WebControls.VerticalAlign
        Private _onBlur As String = ""
        Private _onKeyPress As String = ""
        Private _onKeyDown As String = ""
        Private _onClick As String = ""
        Private _onChange As String = ""
        Private _controlID As String
        Private _DropdowndataSource As IEnumerable

#End Region

#Region " Properties"

        <Bindable(True), Category("Behavior"), NotifyParentProperty(True), DefaultValue("")> Property [OnBlurEvent]() As String
            Get
                Return _onBlur
            End Get

            Set(ByVal Value As String)
                _onBlur = Value
            End Set

        End Property

        <Bindable(True), Category("Behavior"), NotifyParentProperty(True), DefaultValue("")> Property [OnKeyPressEvent]() As String
            Get
                Return _onKeyPress
            End Get

            Set(ByVal Value As String)
                _onKeyPress = Value
            End Set

        End Property

        <Bindable(True), Category("Behavior"), NotifyParentProperty(True), DefaultValue("")> Property [OnClickEvent]() As String
            Get
                Return _onClick
            End Get

            Set(ByVal Value As String)
                _onClick = Value
            End Set

        End Property

        <Bindable(True), Category("Behavior"), NotifyParentProperty(True), DefaultValue("")> Property [OnChangeEvent]() As String
            Get
                Return _onChange
            End Get

            Set(ByVal Value As String)
                _onChange = Value
            End Set

        End Property

        <Bindable(True), Category("Behavior"), NotifyParentProperty(True), DefaultValue("")> Property [OnKeyDownEvent]() As String
            Get
                Return _onKeyDown
            End Get

            Set(ByVal Value As String)
                _onKeyDown = Value
            End Set

        End Property

        <Bindable(True), NotifyParentProperty(True), DefaultValue("")> Property [ID]() As String
            Get
                Return _controlID
            End Get

            Set(ByVal Value As String)
                _controlID = Value
            End Set

        End Property

        <Bindable(True), Description("The name of the datafield to display!"), Category("Data"), NotifyParentProperty(True), DefaultValue("")> Public Property DataTextField() As String
            Get
                Return _dataTextField
            End Get
            Set(ByVal value As String)
                _dataTextField = value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue(True)> Property [HorizontalAlignment]() As System.Web.UI.WebControls.HorizontalAlign
            Get
                Return _horizontalAlignment
            End Get

            Set(ByVal Value As System.Web.UI.WebControls.HorizontalAlign)
                _horizontalAlignment = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue(True)> Property [VerticalAlignment]() As System.Web.UI.WebControls.VerticalAlign
            Get
                Return _verticalAlignment
            End Get

            Set(ByVal Value As System.Web.UI.WebControls.VerticalAlign)
                _verticalAlignment = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue(True)> Property [Visible]() As Boolean
            Get
                Return _visible
            End Get

            Set(ByVal Value As Boolean)
                _visible = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue(True)> Property [Enabled]() As Boolean
            Get
                Return _enabled
            End Get

            Set(ByVal Value As Boolean)
                _enabled = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue("")> Property [Width]() As System.Web.UI.WebControls.Unit
            Get
                Return _width
            End Get

            Set(ByVal Value As System.Web.UI.WebControls.Unit)
                _width = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue("")> Property [Height]() As System.Web.UI.WebControls.Unit
            Get
                Return _height
            End Get

            Set(ByVal Value As System.Web.UI.WebControls.Unit)
                _height = Value
            End Set
        End Property

        <Bindable(True), Category("Appearance"), NotifyParentProperty(True), DefaultValue("")> Property [CSSClass]() As String
            Get
                Return _CSSClass
            End Get

            Set(ByVal Value As String)
                _CSSClass = Value
            End Set
        End Property

        <Bindable(True), NotifyParentProperty(True), DefaultValue("")> Property [ControlType]() As TypeOfControl
            Get
                Return _controlType
            End Get

            Set(ByVal Value As TypeOfControl)
                _controlType = Value
            End Set

        End Property

        <Bindable(True), _
           Category("Data"), _
           Description("The dropdownlist datasource."), _
           DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> Public Property DropdownDataSource() As IEnumerable
            Get
                Return _DropdowndataSource
            End Get
            Set(ByVal Value As IEnumerable)
                _DropdowndataSource = Value
            End Set
        End Property

#End Region

    End Class

End Namespace


